<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    
    function fun(){
        console.log('a3-->',this,a);
        console.log('b1-->',this,b);
        var b=3;
        this.funs = function (){
            console.log('b3-->',this,b);
            var c=1;
            console.log('c2-->',this,c);
        }
        this.funs();
        console.log('b2-->',this,b);
    }
    console.log('a1-->',this,a);
    a=2//初始化不会提升
    console.log('a2-->',this,a);
    fun();
    var a//提升

   
//   a1 undefined
//   a2 2
//   a3 2
//   b1 undefined
//   b3 3
//   c2 1
//   b2 3
    
    </script>
</body>
</html>